<template>
    <div>
        <van-tabs @click="onClick" v-model="activet">
            <van-tab title="正在热映" class="aaa"></van-tab>
            <van-tab title="即将上映" class="bbb"></van-tab>
        </van-tabs>
    </div>
</template>

<script>
import Vue from 'vue';
import { Tab, Tabs } from 'vant';

Vue.use(Tab);
Vue.use(Tabs);
export default {
    created() {
        
    },
    computed: {
        activet:{
            get(){
                return this.$store.state.activet
            },
            set(){
                this.$store.commit('changeActivet', this.name)
            }
        }
        
    },
    data () {
        return {
            // activet:0
            name: 0
        }
    },
    mounted() {
        this.$router.push('/movie/nowplaying')
    },
    methods: {
        onClick(name, title) {
            this.name = name
            if (title === "正在热映") {
                this.$router.push('/movie/nowplaying')
            }else{
                this.$router.push('/movie/moviedetail')
            }
        },
    }
}
</script>

<style>
    
</style>
